<template>
	<view class="home" style="position: relative;">
		<view class="toptext">
			<view class="teaa">
				<view class="lefaa">
					{{evennub}}
				</view>
				<view class="lefbb">
					均匀度
				</view>
			</view>
			<view class="tebb">

			</view>
			<view class="teaa">
				<view class="lefaa">
					{{xinhaos}}
				</view>
				<view class="lefbb">
					信号数
				</view>
			</view>
		</view>
		<view class="secnub" :class="isActive?'secnub':'lighting'">
			<view class="secaa">
				用时
			</view>
			<!-- <view class="secaa"> -->
			<view class="secaa" v-show="saveif">
				<u-count-to ref="uCountTo" :useEasing="false" :duration="duration" decimals="2" :endVal="endVal"
					:autoplay="autoplay" :fontSize="55" color="#5292b0" @end="end"></u-count-to>
			</view>
			<view class="secaa" style="font-size: 120rpx;color: #5292b0;" v-show="!saveif">
				{{displayValue}}
			</view>
			<view class="secaa">
				秒
			</view>
		</view>
		<!-- 测点 -->
		<view class="cedian">
			<view class="">
				测点：
			</view>
			<view class="butt">
				<!-- <uni-icons color="#fff" type="arrow-left" size="30"></uni-icons> -->
				<u-button @click="updata" type="primary" :disabled="true" color="#85aca9" icon="arrow-leftward"
					shape="circle"></u-button>
			</view>
			<view class="buttnub">
				{{oneobj.nub}}
			</view>
			<view class="buttnub" v-if="oneobj.name !== ''">
				{{oneobj.name}}
			</view>
			<view class="butt">
				<!-- <uni-icons color="#fff" type="arrow-right" size="30"></uni-icons> -->
				<u-button @click="downdata" type="primary" :disabled="true" color="#85aca9" icon="arrow-rightward"
					shape="circle"></u-button>
			</view>

		</view>
		<!-- 测点 -->
		<view class="context">
			点流速：{{liusu}}
		</view>
		<!-- 		<view class="max">
			<view class="">
				终端时长：{{allqiuhe}}
			</view>
		</view> -->
		<view class="conbutt">
			<view class="buttsize">
				<u-button type="primary" :disabled="leddisab" shape="circle" color="#5292b0" :text="timeSta"
					size="large" @click="showmeasure = true"></u-button>
			</view>
			<!-- 			<view class="buttsize"> :disabled="disabled"
				<u-button type="primary" color="#02bc90" text="暂停" size="large" @click="reStart"
					:disabled="!(disabled)"></u-button>
			</view> -->
		</view>
		<view @click="jshuqi" class="dianji" hover-class="dianjihcl" :hover-stay-time="50" v-show="jishuIf">
			计数
		</view>
		<view class="" v-show="false">
			<u-count-to ref="uToRef" :useEasing="false" :endVal="5000" :duration="5000" :autoplay="false"></u-count-to>
		</view>

		<view class="xinhmax" style="display: flex;justify-content: center;align-items: center;">
			<view class="" v-if="xinhaoif" style="border-style: solid;
  border-color: transparent;
  border-width: 35rpx 0 35rpx 35rpx;
  border-left-color: #ff1e1e;border-radius: 10rpx;">
			</view>
			<view class="hmax" :style="{marginLeft:`${item.w}rpx`,height:`${item.h}rpx`}"
				v-for="(item,index) in xinhaoma" :key="index">

			</view>
		</view>
		<!-- 保存 -->
		<view class="save" v-if="savedataif">
			<!-- <view class="save"> -->
			<u-button @click="modalshow = true" :disabled="disabled" type="primary" text="保存测量数据"
				shape="circle"></u-button>
			<!-- <u-button @click="savedata" :disabled="disabled" type="primary" text="保存测量数据" shape="circle"></u-button> -->
		</view>
		<!-- 弹窗 -->
		<u-modal :show="showdata" @confirm="confirm">
			<u-icon name="info-circle-fill" color="#ee6868" size="28"></u-icon>
			<text style="color: #ee6868;font-size: 40rpx;margin: 0 10rpx;">数据异常，请重新测量。</text>
		</u-modal>
		<!-- <button @click="showfn" >1265456</button> -->
		<!-- 遮罩层 -->
		<view class=""
			style="background-color: rgb(149, 149, 149,0.0);width: 750rpx;height: 65vh;position: absolute;top: 0;"
			v-if="disabled">
		</view>
		<!-- 测量遮罩 -->
		<u-modal :show="showmeasure" :title="measurecontent" showCancelButton :closeOnClickOverlay="true"
			@confirm="confirmmeasure" @cancel="cancelmeasure"></u-modal>
		<!-- 保存遮罩 -->
		<u-modal :show="modalshow" :title="modalcontent" showCancelButton :closeOnClickOverlay="true"
			@confirm="confirmmodal" @cancel="cancelmodal"></u-modal>
		<!-- 		<button @click="qingkomg">清空</button>
		<button @click="quzhi">取值</button> -->
		<!-- 点击计时器 -->

	</view>
</template>

<script>
	import dayjs from '@/common/dayjs.min.js';
	const SixUniTts = uni.requireNativePlugin("SmallSix-SixUniTts")
	export default {
		data() {
			return {
				isActive: true,
				jishuIf: false,
				leddisab: false,
				saveif: true,
				timeSta: '测量',
				timeLeft: 120,
				timerSc: null,
				disabStart: false,
				monnub: '测量',
				montage: '',
				startBLE: true,
				measurecontent: '开始测量',
				modalcontent: '是否保存测量数据',
				showmeasure: false,
				modalshow: false,
				timer: null,
				xinhaoif: false,
				savedataif: false,
				showdata: false,
				onenub: 0,
				oneobj: {
					nub: '',
					name: ''
				},
				nubone: [],
				disup: true, //切换
				disdow: false, //切换
				xinhaoma: [],
				// allqiuhe: 0,
				displayValue: 120.00,
				duration: 120000,
				liusu: 0,
				evennub: 0,
				disabled: false,
				endVal: 120.00,
				autoplay: false,
				inval: null,
				xinhaos: 0,
				pjunnub: 0,
				maxnub: 0,
				minnub: 0,
				ifbox: false,
				showSecond: 0,
				second: 0,
				ifaa: true,
				dsn: 100,
				isTrigger: false,
				dingshia: false,
				dingshib: false,
				jsif: false,
				dings: false,
				jsonhex: '',
				hexnum: [],
				vuexlist: {},
				fanti: true,
				num: 50,
				list: [],
				deviceId: '',
				serviceId: '',
				characteristics: [],
				characteristicId: '',
				jis: '',
				cr: '',
				fff: '',
				// cezhanall:[],
				// cezhanitem:{
				// 	junyundu:0,
				// 	xinhaoshu:0,
				// 	yongshi:0,
				// 	cedian:{},
				// 	dianliusu:0,
				// },
				test: 0,
				dianfa: null,
				liusuyiData: {},
				iftime: '',
				compare: null
			}
		},
		onLoad(options) {
			this.deviceId = this.vuex_deviceId
			// 传值测点测线
			this.dianfa = options.dianfa
			let cezhanobj = {
				cexians: options.cexians,
				dianfa: options.dianfa
			}
			this.nubon(cezhanobj.cexians, cezhanobj.dianfa)
			// uni.showLoading({
			// 	mask: true,
			// 	title: '开启服务中...'
			// });
			// setTimeout(() => {
			// 	uni.hideLoading()
			// }, 10000)
		},
		onShow() {
			this.liusuyiData = this.vuex_liusuyiData
			// let cezhanobj = {
			// 	cexians: 4,
			// 	dianfa: 1
			// }
			// this.nubon(cezhanobj.cexians, cezhanobj.dianfa)
			this.jinru()
			// 自动保存
			// this.timer = setInterval(() => {
			// 	this.zidong()
			// }, 2000)
		},
		mounted() {
			// 初始化
			SixUniTts.initSixUniTts(res => {})
		},
		destroyed() {
			clearInterval(this.timer)
			this.stopCountdown()
			clearInterval(this.timerSc)
			clearInterval(this.inval)
		},
		methods: {
			// 测试定时器
			dingshiFn() {
				// let t = setInterval(()=>{
				// 	this.jshuqi()
				// },1000)
				// setTimeout(() => {
				//     clearInterval(t); 
				// ;}, 300000);
			},
			// 语音播报
			six() {
				let broadcast = '用时,' + this.displayValue + "," + '均匀度,' + this.evennub + ',' + "信号数," + this.xinhaos +
					',' + '点流速,' + this.liusu + ','
				SixUniTts.setPitch({
					pitch: '1.0f'
				}) //音调
				SixUniTts.setSpeechRate({
					rate: '1.0f'
				}) //语速
				SixUniTts.startSpeech({
					speechText: broadcast
				})

				// 1、initSixUniTts(callback) 初始化引擎
				// 2、setPitch({ pitch: '1.0f' }, callback) 设置音调
				// 3、setSpeechRate({ rate: '1.0f' }, callback) 设置语速
				// 4、startSpeech({ speechText: '小六测试播放' }, callback) 开始播放
				// 5、stop(callback) 停止播放
				// 6、shutdown(callback) 释放资源
			},
			sixErr() {
				let broadcast = '数据异常，请重新测量！'
				SixUniTts.setPitch({
					pitch: '1.0f'
				}) //音调
				SixUniTts.setSpeechRate({
					rate: '1.0f'
				}) //语速
				SixUniTts.startSpeech({
					speechText: broadcast
				})
			},
			// 语音播报
			qingkomg() {
				uni.$u.vuex('vuex_cexian', [])

			},
			quzhi() {
				console.log('取值', this.vuex_cexian);
			},
			// 自动保存
			zidong() {
				if (this.savedataif) {
					this.savedata()
					this.jisuan()
				}
			},
			// 确认保存
			confirmmodal() {
				this.savedata()
				this.modalshow = false
			},
			cancelmodal() {
				this.modalshow = false
			},
			// 保存
			savedata() {
				SixUniTts.stop()
				let all = []
				all = this.vuex_cexian
				let cezhanitem = {
					junyundu: this.evennub,
					xinhaoshu: this.xinhaos,
					yongshi: this.displayValue,
					cedian: this.oneobj,
					dianliusu: this.liusu,
				}
				all.push(cezhanitem)
				uni.$u.vuex('vuex_cexian', all)
				all = []
				uni.showToast({
					title: '已保存',
					mask: true,
					duration: 1500
				});
				this.savedataif = false
				this.downdata()
			},
			// 翻页
			updata() {
				if (this.onenub > 0) {

					// this.allqiuhe = 0
					this.evennub = 0
					this.xinhaos = 0
					this.displayValue = 0
					this.liusu = 0

					this.onenub--
					this.disdow = false
					this.jinru()

				} else {
					this.disup = true
				}
			},
			downdata() {
				if (this.onenub < this.nubone.length - 1) {
					// this.allqiuhe = 0
					this.evennub = 0
					this.xinhaos = 0
					this.displayValue = 0
					this.liusu = 0
					this.onenub += 1
					this.disup = false
					this.jinru()
				} else {
					uni.redirectTo({
						url: '/pagesA/aproductA/countlist?&dianfa=' + this.dianfa
					});
					this.disdow = true
				}
			},
			// 测线数量
			nubon(data, nab) {
				// 一点法
				if (nab == 1) {
					this.nubone = []
					for (let i = 0; i < data; i++) {
						let obj = {
							id: i,
							nub: 1 + i,
							name: ''
						}
						this.nubone.push(obj)
					}
				} else {
					// 三点法
					this.nubone = []
					let arrdata = []
					let name = ['A', 'B', 'C']
					for (let i = 1; i <= data; i++) {
						for (let m = 0; m < 3; m++) {
							arrdata.push({
								nub: i,
								name: name[m]
							})
						}
					}
					for (let i = 0; i < arrdata.length; i++) {
						arrdata[i].id = i + 1

					}
					this.nubone = arrdata

				}
			},
			// 点击执行
			jinru() {
				this.oneobj = this.nubone[this.onenub]

			},
			// 120秒触发
			finish() {
				this.showfn()
			},
			// 弹窗
			showfn() {
				this.showdata = true
			},
			confirm() {
				this.showdata = false
			},
			uTorefFn() {
				this.$refs.uToRef.start();
				this.montage = this.$refs.uToRef.displayValue
				console.log('时间', this.montage, this.$refs.uToRef.lastTime);
				// console.log('格式化时间',dayjs(this.$refs.uToRef.lastTime).format('ss')) // '25/01/2019');

				var ti = this.$refs.uToRef.lastTime
				let getTime = this.getTimeDifference(this.iftime, ti)
				console.log('aaaaaa',getTime);
				// var compare = dayjs(this.iftime).from(ti) 
				// 计算毫秒
				this.compare = (getTime.seconds * 1000  + getTime.milliseconds) / 1000
				this.iftime = ti
				
				console.log('****',this.xinhaoma);
			},
			// 时间差值
			jshuqi() {
				this.uTorefFn()
				this.listenValueChange()
				if (true) {
					this.isActive = false
					this.music.play_didi()
					setTimeout(() => {
						this.isActive = true
					}, 500)
				}
			},
			// 【9】监听消息变化
			listenValueChange() {
				if (this.startBLE) {
					console.log('未开始');
					return
				}
				// if (!(this.startBLE)) {
				// 	this.montage = 2000
				// }

				// 转换
				let resHex = this.montage * 1

				if (this.ifaa) {
					this.xinhaoif = true
					this.getVarifyCode()
					this.start()
					this.ifaa = false
					this.saveif = true
					this.disabFn()
					return
				}
				// 自动计算
				if (this.dingshia && this.dingshib) {
					if (resHex) {
						this.hexnum.push(resHex)
						this.reStart()
						clearInterval(this.inval)
						// 信号展示
						let obj = {
							w: 0,
							h: 0
						}
						obj.w = parseInt(resHex / 1000 * 2.5)
						// obj.h = parseInt(resHex / 1000 * 20)
						obj.h = parseInt(this.compare * 20)
						this.xinhaoma.push(obj)

					}
					// 求和

					// this.allqiuhe = this.sum(this.hexnum) / 1000

					// 计算

					this.xinhaos = this.hexnum.length
					// 计算流速
					setTimeout(() => {
						let a = this.liusuyiData.aa * 1
						let b = this.liusuyiData.bb * 1
						let c = this.liusuyiData.bb * 1
						this.liusu = a + b * (this.xinhaos * c / this.displayValue)
						this.liusu = parseFloat(this.liusu.toFixed(4))
						// 判断均匀度
						if (this.evennub < 100 && this.displayValue < 120) {
							this.six()
							this.savedataif = true
						} else {
							this.finish()
							this.sixErr()

						}
					}, 300)

					// 均匀度
					let x = this.sum(this.hexnum) / this.hexnum.length

					let y = ''
					let z = []
					for (var i = 0; i < this.hexnum.length; i++) {
						y = (x - this.hexnum[i]) * (x - this.hexnum[i])
						z.push(y)
					}
					let n = this.sum(z) / this.hexnum.length

					let m = Math.sqrt(n) / 10
					this.evennub = m.toFixed(0)

					// 均匀度

					this.dingshia = false
					this.dingshib = false
					this.jsif = false

				}
				if (this.jsif) {
					let hexnub = resHex
					if (hexnub) {

						this.hexnum.push(hexnub)
						// this.allqiuhe = this.sum(this.hexnum) / 1000
						// 信号展示
						let obj = {
							w: 0,
							h: 0
						}
						obj.w = parseInt(hexnub / 1000 * 2.5)
						// obj.h = parseInt(hexnub / 1000 * 20)
						obj.h = parseInt(this.compare * 20)
						this.xinhaoma.push(obj)
					}
					this.xinhaos = this.hexnum.length
				}
			},
			// 测量确认
			confirmmeasure() {
				this.dingshiFn()


				this.jishuIf = true
				this.leddisab = true
				this.jisuan()
				setTimeout(() => {
					this.leddisab = false
					// this.timeSta = '测量'
				}, 120000)
				this.showmeasure = false
			},
			//测量取消
			cancelmeasure() {
				this.showmeasure = false
			},
			//测量
			jisuan() {
				this.timeLeft = 120
				this.reStart()
				this.displayValue = 0
				this.montage = ''
				this.monnub = ''
				// 定时器120
				this.disabStart = true

				this.startBLE = false
				clearInterval(this.inval)
				this.xinhaoif = false
				this.savedataif = false
				// this.allqiuhe = 0
				this.xinhaoma.length = []
				this.liusu = 0,
					this.evennub = 0,
					this.xinhaos = 0,
					this.pjunnub = 0,
					this.maxnub = 0,
					this.minnub = 0,
					this.disabled = true
				this.ifbox = true
				this.dsn = 100
				this.hexnum.length = 0
				this.jsif = true
				this.dingshib = true
				this.ifaa = true
				this.second = 0

				// 保持屏幕常亮
				uni.setKeepScreenOn({
					keepScreenOn: true
				});
			},
			// 计时器触发方法
			end() {
				// this.finish()
				this.disabled = false

			},
			// 开始定时120秒
			disabFn() {
				this.timerSc = setInterval(() => {
					if (this.timeLeft > 0) {
						this.timeLeft--
						// this.timeSta = this.timeLeft
					} else {
						this.stopCountdown()
					}
				}, 1000);
			},
			stopCountdown() {
				this.disabStart = false
				this.timeLeft = 120
				clearInterval(this.timerSc);
				// this.timerSc = null;
			},
			// 开始
			start() {
				this.$refs.uCountTo.start();
			},
			// 继续
			paused() {
				this.$refs.uCountTo.paused();
			},
			// 暂停
			reStart() {
				// this.jishuIf = false
				clearInterval(this.timerSc);
				this.saveif = false
				this.startBLE = true
				this.$refs.uCountTo.reStart()
				this.displayValue = this.$refs.uCountTo.displayValue

				clearInterval(this.inval)
				this.disabled = false
				this.dingshia = false
				this.dingshib = false
				this.jsif = false
			},
			// 求和
			sum(arr) {
				var sum = 0;
				for (var i = 0; i < arr.length; i++) {
					sum += arr[i]
				}
				return sum
			},
			fuwei() {
				this.showSecond = 0
				this.second = 0
			},
			// 定时器
			getVarifyCode() {
				// if (this.isTrigger) return
				// let n = 10;
				this.inval = setInterval(
					() => {
						if (this.dsn === 0) {
							// this.isTrigger = false
							clearInterval(this.inval)
							this.jsif = false
							this.dingshia = true

						} else {


							// this.isTrigger = true
							this.dsn -= 1
						}
					},
					1000
				)
			},
			// 获取hex数据
			hexCharCodeToStr(hexCharCodeStr) {

				var trimedStr = hexCharCodeStr.trim();
				var rawStr =
					trimedStr.substr(0, 2).toLowerCase() === "0x" ?
					trimedStr.substr(2) :
					trimedStr;
				var len = rawStr.length;
				if (len % 2 !== 0) {
					alert("Illegal Format ASCII Code!");
					return "";
				}
				var curCharCode;
				var resultStr = [];
				for (var i = 0; i < len; i = i + 2) {
					curCharCode = parseInt(rawStr.substr(i, 2), 16); // ASCII Code Value
					resultStr.push(String.fromCharCode(curCharCode));
				}
				return resultStr.join("");

			},
			ab2hex(buffer) {
				const hexArr = Array.prototype.map.call(
					new Uint8Array(buffer),
					function(bit) {
						return ('00' + bit.toString(16)).slice(-2)
					}
				)
				return hexArr.join('')
			},
			// crc校验
			crc16up(data) {
				var res = this.crc16(Buffer.from(data, "hex"));
				this.cr = res
			},
			crc16(data) {
				let crcValue = 0xFFFF;
				for (let i = 0; i < data.length; i++) {
					crcValue ^= data[i] & 0xFFFF
					for (let j = 0; j < 8; j++) {
						if (crcValue & 0x0001) {
							crcValue >>= 1
							crcValue ^= 0xA001
						} else {
							crcValue >>= 1
						}
					}
				}

				let crcstr = crcValue.toString(16).toUpperCase();
				if (crcstr.length % 2 == 0) {
					let crcArr = crcstr.match(/.{1,2}/g)

					let arr = new Array(2)
					arr[0] = crcArr[1]
					arr[1] = crcArr[0]
					return arr
					// return result;
				} else {
					let str = '0' + crcstr
					let crcArr = str.match(/.{1,2}/g)
					let arr = new Array(2)
					arr[0] = crcArr[1]
					arr[1] = crcArr[0]
					return arr
				}
				// crcValue = crcValue.toString(16)
				// let crcArr = new Array(2)
				// crcArr[0] = crcValue.substring(2, 4)
				// crcArr[1] = crcValue.substring(0, 2)
				// return crcArr
			},

			duankai() {
				uni.closeBLEConnection({
					deviceId: this.deviceId,
					success(res) {
						uni.showToast({
							title: '蓝牙已断开',
							icon: 'success',
							mask: true,
							duration: 2000
						});
					}
				})
			},
			inpuaa() {
				this.modifyup()
			},
			// 分包
			/**
			 * 向设备发送消息(分包发送，单包20字节，递归发送)
			 */
			sendMsgToKey(buffer) {
				var that = this //vue中的this
				const packageSize = 20 //分包大小
				if (buffer.byteLength <= 20) { //如果小于20直接发送，不再继续调用
					uni.writeBLECharacteristicValue({
						// 这里的 deviceId 需要在上面的 getBluetoothDevices 或 onBluetoothDeviceFound 接口中获取
						deviceId: that.deviceId,
						// 这里的 serviceId 需要在上面的 getBLEDeviceServices 接口中获取
						serviceId: that.serviceId,
						// 这里的 characteristicId 需要在上面的 getBLEDeviceCharacteristics 接口中获取
						characteristicId: that.fff, //第二步写入的特征值
						// 这里的value是ArrayBuffer类型
						value: buffer,
						writeType: 'write',
						success: (res) => {
							//此时设备已接收到你写入的数据
							setTimeout(() => {
								if (this.fanti) {
									this.modifyup()
								}
							}, 500)

						},
						fail: (err) => {
							if (err.errCode == 10006) {
								uni.hideLoading()
								uni.showToast({
									title: '当前连接已断开',
									icon: 'success',
									mask: true,
									duration: 2000
								});
							}
							if (err.errCode == 10004) {
								uni.hideLoading()
								uni.showToast({
									title: '未找到服务',
									icon: 'success',
									mask: true,
									duration: 2000
								});
							}
							if (err.errCode == 10005) {
								uni.hideLoading()
								uni.showToast({
									title: '未找到特征值',
									icon: 'success',
									mask: true,
									duration: 2000
								});
							}
						},
						complete: function() {}
					})
				} else { //如果大于20发送完成后继续递归调用
					var newData = buffer.slice(20)
					var writeBuffer = buffer.slice(0, 20)
					uni.writeBLECharacteristicValue({
						// 这里的 deviceId 需要在上面的 getBluetoothDevices 或 onBluetoothDeviceFound 接口中获取
						deviceId: that.deviceId,
						// 这里的 serviceId 需要在上面的 getBLEDeviceServices 接口中获取
						serviceId: that.serviceId,
						// 这里的 characteristicId 需要在上面的 getBLEDeviceCharacteristics 接口中获取
						characteristicId: that.fff, //第二步写入的特征值
						// 这里的value是ArrayBuffer类型
						value: writeBuffer,
						writeType: 'write',
						success: function(res) {
							//写入成功后继续递归调用发送剩下的数据
							that.sendMsgToKey(newData)
						},
						fail: (err) => {
							if (err.errCode == 10006) {
								uni.hideLoading()
								uni.showToast({
									title: '当前连接已断开',
									icon: 'success',
									mask: true,
									duration: 2000
								});
							}
							if (err.errCode == 10004) {
								uni.hideLoading()
								uni.showToast({
									title: '未找到服务',
									icon: 'success',
									mask: true,
									duration: 2000
								});
							}
							if (err.errCode == 10005) {
								uni.hideLoading()
								uni.showToast({
									title: '未找到特征值',
									icon: 'success',
									mask: true,
									duration: 2000
								});
							}
						},
						complete: function() {}
					})
				}

			},
			getTimeDifference(start, end) {
				const startTime = new Date(start);
				const endTime = new Date(end);
				const timeDiff = Math.abs(endTime.getTime() - startTime.getTime());

				// 计算差值的小时、分钟和秒数
				const hours = Math.floor(timeDiff / (1000 * 60 * 60));
				const minutes = Math.floor((timeDiff % (1000 * 60 * 60)) / (1000 * 60));
				const seconds = Math.floor((timeDiff % (1000 * 60)) / 1000);
				var milliseconds = Math.floor(timeDiff % 1000);// 计算毫秒数

				return {
					hours,
					minutes,
					seconds,
					milliseconds
				};
			}
		}
	}
</script>
<style>
	page {
		background-color: #f8f8f8;
	}
</style>
<style scoped lang="scss">
	.max {
		margin: 20rpx auto;
		width: 600rpx;
		font-size: 40rpx;
		display: flex;
		align-items: center;
		color: #848484;
		border-radius: 20rpx;
		padding: 10rpx;
		background-color: #f0f0f0;
		justify-content: space-around;
	}

	.showshi {
		width: 300rpx;
		font-size: 40rpx;
		padding: 10rpx;
		margin: 0 auto;
		border-radius: 30rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		background-color: #ffffff;
		color: #000000;
		border: #9ac3a4 solid 10rpx;
		font-size: 80rpx;
	}

	.hometop {
		width: 650rpx;
		margin: 0 auto;
		padding: 20rpx;
		display: flex;
		border-radius: 10rpx;
		color: #fff;
		justify-content: space-around;
		align-items: center;
		background-color: #34495e;
	}

	.zidongjishi {
		margin: 50rpx 0;
	}

	.shujv {
		display: flex;
		align-items: center;
		flex-wrap: wrap;
	}

	// 信号数
	.toptext {
		margin: 30rpx auto;
		width: 670rpx;
		height: 180rpx;
		border-radius: 130rpx;
		display: flex;
		align-items: center;
		justify-content: space-around;
		background-color: #f2f2f2;

		.teaa {
			width: 250rpx;
			text-align: center;
			font-size: 40rpx;

			// background-color: #34495e;
			.lefaa {
				font-size: 80rpx;
				color: #5292b0;
			}
		}

		.tebb {
			width: 2rpx;
			height: 150rpx;
			background-color: #c6c6c6;
		}
	}

	// 秒表
	.secnub {
		width: 380rpx;
		height: 380rpx;
		margin: 10rpx auto;
		font-size: 50rpx;
		color: #757575;
		border-radius: 300rpx;
		border: 10rpx solid #5292b0;
		display: flex;
		flex-direction: column;
		justify-content: space-around;
		align-items: center;
	}

	.lighting {
		border: 10rpx solid #00ff00;
		background-color: #ecffe7;
		color: #00ff00;

	}

	// 流速
	.context {
		width: 640rpx;
		height: 100rpx;
		border-radius: 90rpx;
		margin: 20rpx auto;
		background-color: #f0f0f0;
		display: flex;
		justify-content: center;
		align-items: center;
		color: #5292b0;
		font-size: 60rpx;
	}

	.conbutt {
		display: flex;
		justify-content: space-around;
		align-items: center;

		.buttsize {
			width: 600rpx;
		}
	}

	.xinhmax {
		margin: 20rpx 0;
		padding: 0 30rpx;
		display: flex;

		// background-color: #000000;

		.hmax {
			width: 10rpx;
			height: 60rpx;
			border-radius: 10rpx;
			background-color: #ff1e1e;
		}
	}

	.save {
		width: 600rpx;
		margin: 0 auto;
	}

	.cedian {
		width: 650rpx;
		margin: 20rpx auto;
		padding: 15rpx;
		color: #4b5f61;
		font-size: 35rpx;
		display: flex;
		justify-content: space-around;
		align-items: center;
		// border: #dae6e7 solid 1rpx;
		background-color: #e5f3f4;
		border-radius: 50rpx;
		box-shadow: 0rpx 0rpx 30rpx #a2bdc2;

		// .butt {
		// 	padding: 5rpx 20rpx;
		// 	border-radius: 20rpx;
		// 	background-color: #83999d;
		// }
		.buttnub {
			font-size: 50rpx;
		}
	}

	.dianji {
		width: 150rpx;
		height: 150rpx;
		border-radius: 150rpx;
		margin: 20rpx auto;
		text-align: center;
		line-height: 150rpx;
		background-color: #5292b0;
		color: #ffffff;
		padding: 20rpx;
		font-size: 55rpx;
		border: 10rpx double #f7f7f7;
		border-width: 20rpx 20rpx;
	}

	.dianjihcl {
		background-color: #5292b0;
		color: #507c6f;
	}
</style>